package lol.oxguy3.webernetview;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Environment;
import android.os.Vibrator;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

public class WebernetViewActivity extends Activity implements View.OnClickListener, DialogInterface.OnClickListener {
	
	Context cxt;
	String deliciousbabies;
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        cxt = this;
        
        WebView wv = (WebView)findViewById(R.id.webView1);
        wv.loadUrl("http://haydencity.net");
        Button btn = (Button)findViewById(R.id.button1);
        btn.setOnClickListener(this);
		
		System.out.println(cxt.getFilesDir().getAbsolutePath());
    }

	public void onClick(View v) {
		
		/*File tard = new File(cxt.getFilesDir(), "tard.txt");
		try {
			System.out.println(tard.createNewFile());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		/*String FILENAME = "derp.txt";
		String string = "It is a melanchoffy object to those, who walk through this great town,\nor travel in the country, when they see the streets, the roads and\ncabbin-doors crowded with beggars of the female sex, followed by three,\nfour, or six children, all in rags, and importuning every passenger for\nan alms. These mothers instead of being able to work for their honest\nlivelihood, are forced to employ all their time in stroling to beg\nsustenance for their helpless infants who, as they grow up, either turn\nthieves for want of work, or leave their dear native country, to fight\nfor the Pretender in Spain, or sell themselves to the Barbadoes.\n\nI think it is agreed by all parties, that this prodigious number of\nchildren in the arms, or on the backs, or at the heels of their mothers,\nand frequently of their fathers, is in the present deplorable state of\nthe kingdom, a very great additional grievance; and therefore whoever\ncould find out a fair, cheap and easy method of making these children\nsound and useful members of the common-wealth, would deserve so well of\nthe publick, as to have his statue set up for a preserver of the nation.\n\nBut my intention is very far from being confined to provide only for the\nchildren of professed beggars: it is of a much greater extent, and shall\ntake in the whole number of infants at a certain age, who are born of\nparents in effect as little able to support them, as those who demand\nour charity in the streets.\n\nAs to my own part, having turned my thoughts for many years, upon this\nimportant subject, and maturely weighed the several schemes of\nour projectors, I have always found them grossly mistaken in their\ncomputation. It is true, a child just dropt from its dam, may be\nsupported by her milk, for a solar year, with little other nourishment:\nat most not above the value of two shillings, which the mother may\ncertainly get, or the value in scraps, by her lawful occupation of\nbegging; and it is exactly at one year old that I propose to provide for\nthem in such a manner, as, instead of being a charge upon their parents,\nor the parish, or wanting food and raiment for the rest of their lives,\nthey shall, on the contrary, contribute to the feeding, and partly to\nthe cloathing of many thousands.\n\nThere is likewise another great advantage in my scheme, that it will\nprevent those voluntary abortions, and that horrid practice of\nwomen murdering their  @#!*%  children, alas! too frequent among us,\nsacrificing the poor innocent babes, I doubt, more to avoid the expence\nthan the shame, which would move tears and pity in the most savage and\ninhuman breast.\n\nThe number of souls in this kingdom being usually reckoned one million\nand a half, of these I calculate there may be about two hundred thousand\ncouple whose wives are breeders; from which number I subtract thirty\nthousand couple, who are able to maintain their own children, (although\nI apprehend there cannot be so many, under the present distresses of\nthe kingdom) but this being granted, there will remain an hundred and\nseventy thousand breeders. I again subtract fifty thousand, for those\nwomen who miscarry, or whose children die by accident or disease within\nthe year. There only remain an hundred and twenty thousand children of\npoor parents annually born. The question therefore is, How this number\nshall be reared, and provided for? which, as I have already said, under\nthe present situation of affairs, is utterly impossible by all the\nmethods hitherto proposed. For we can neither employ them in handicraft\nor agriculture; we neither build houses, (I mean in the country) nor\ncultivate land: they can very seldom pick up a livelihood by stealing\ntill they arrive at six years old; except where they are of towardly\nparts, although I confess they learn the rudiments much earlier;\nduring which time they can however be properly looked upon only as\nprobationers: As I have been informed by a principal gentleman in the\ncounty of Cavan, who protested to me, that he never knew above one or\ntwo instances under the age of six, even in a part of the kingdom so\nrenowned for the quickest proficiency in that art.\n\nI am assured by our merchants, that a boy or a girl before twelve years\nold, is no saleable commodity, and even when they come to this age, they\nwill not yield above three pounds, or three pounds and half a crown\nat most, on the exchange; which cannot turn to account either to the\nparents or kingdom, the charge of nutriments and rags having been at\nleast four times that value.\n\nI shall now therefore humbly propose my own thoughts, which I hope will\nnot be liable to the least objection.\n\nI have been assured by a very knowing American of my acquaintance in\nLondon, that a young healthy child well nursed, is, at a year old, a\nmost delicious nourishing and wholesome food, whether stewed, roasted,\nbaked, or boiled; and I make no doubt that it will equally serve in a\nfricasie, or a ragoust.\n\nI do therefore humbly offer it to publick consideration, that of the\nhundred and twenty thousand children, already computed, twenty thousand\nmay be reserved for breed, whereof only one fourth part to be males;\nwhich is more than we allow to sheep, black cattle, or swine, and my\nreason is, that these children are seldom the fruits of marriage, a\ncircumstance not much regarded by our savages, therefore, one male will\nbe sufficient to serve four females. That the remaining hundred thousand\nmay, at a year old, be offered in sale to the persons of quality and\nfortune, through the kingdom, always advising the mother to let them\nsuck plentifully in the last month, so as to render them plump, and fat\nfor a good table. A child will make two dishes at an entertainment for\nfriends, and when the family dines alone, the fore or hind quarter will\nmake a reasonable dish, and seasoned with a little pepper or salt, will\nbe very good boiled on the fourth day, especially in winter.\n\nI have reckoned upon a medium, that a child just born will weigh 12\npounds, and in a solar year, if tolerably nursed, encreaseth to 28\npounds.\n\nI grant this food will be somewhat dear, and therefore very proper for\nlandlords, who, as they have already devoured most of the parents, seem\nto have the best title to the children.\n\nInfant's flesh will be in season throughout the year, but more plentiful\nin March, and a little before and after; for we are told by a grave\nauthor, an eminent French physician, that fish being a prolifick dyet,\nthere are more children born in Roman Catholick countries about nine\nmonths after Lent, the markets will be more glutted than usual, because\nthe number of Popish infants, is at least three to one in this kingdom,\nand therefore it will have one other collateral advantage, by lessening\nthe number of Papists among us.\n\nI have already computed the charge of nursing a beggar's child (in which\nlist I reckon all cottagers, labourers, and four-fifths of the farmers)\nto be about two shillings per annum, rags included; and I believe no\ngentleman would repine to give ten shillings for the carcass of a good\nfat child, which, as I have said, will make four dishes of excellent\nnutritive meat, when he hath only some particular friend, or his\nown family to dine with him. Thus the squire will learn to be a good\nlandlord, and grow popular among his tenants, the mother will have eight\nshillings neat profit, and be fit for work till she produces another\nchild.\n\nThose who are more thrifty (as I must confess the times require) may\nflea the carcass; the skin of which, artificially dressed, will make\nadmirable gloves for ladies, and summer boots for fine gentlemen.\n\nAs to our City of Dublin, shambles may be appointed for this purpose, in\nthe most convenient parts of it, and butchers we may be assured will not\nbe wanting; although I rather recommend buying the children alive, and\ndressing them hot from the knife, as we do roasting pigs.\n\nA very worthy person, a true lover of his country, and whose virtues\nI highly esteem, was lately pleased, in discoursing on this matter, to\noffer a refinement upon my scheme. He said, that many gentlemen of this\nkingdom, having of late destroyed their deer, he conceived that the\nwant of venison might be well supply'd by the bodies of young lads and\nmaidens, not exceeding fourteen years of age, nor under twelve; so great\na number of both sexes in every country being now ready to starve for\nwant of work and service: And these to be disposed of by their parents\nif alive, or otherwise by their nearest relations. But with due\ndeference to so excellent a friend, and so deserving a patriot, I\ncannot be altogether in his sentiments; for as to the males, my American\nacquaintance assured me from frequent experience, that their flesh was\ngenerally tough and lean, like that of our school-boys, by continual\nexercise, and their taste disagreeable, and to fatten them would not\nanswer the charge. Then as to the females, it would, I think, with\nhumble submission, be a loss to the publick, because they soon would\nbecome breeders themselves: And besides, it is not improbable that some\nscrupulous people might be apt to censure such a practice, (although\nindeed very unjustly) as a little bordering upon cruelty, which, I\nconfess, hath always been with me the strongest objection against any\nproject, how well soever intended.\n\nBut in order to justify my friend, he confessed, that this expedient\nwas put into his head by the famous Salmanaazor, a native of the island\nFormosa, who came from thence to London, above twenty years ago, and in\nconversation told my friend, that in his country, when any young person\nhappened to be put to death, the executioner sold the carcass to persons\nof quality, as a prime dainty; and that, in his time, the body of a\nplump girl of fifteen, who was crucified for an attempt to poison the\nEmperor, was sold to his imperial majesty's prime minister of state, and\nother great mandarins of the court in joints from the gibbet, at four\nhundred crowns. Neither indeed can I deny, that if the same use were\nmade of several plump young girls in this town, who without one single\ngroat to their fortunes, cannot stir abroad without a chair, and appear\nat a play-house and assemblies in foreign fineries which they never will\npay for; the kingdom would not be the worse.\n\nSome persons of a desponding spirit are in great concern about that vast\nnumber of poor people, who are aged, diseased, or maimed; and I have\nbeen desired to employ my thoughts what course may be taken, to ease\nthe nation of so grievous an incumbrance. But I am not in the least pain\nupon that matter, because it is very well known, that they are every day\ndying, and rotting, by cold and famine, and filth, and vermin, as fast\nas can be reasonably expected. And as to the young labourers, they\nare now in almost as hopeful a condition. They cannot get work, and\nconsequently pine away from want of nourishment, to a degree, that if\nat any time they are accidentally hired to common labour, they have not\nstrength to perform it, and thus the country and themselves are happily\ndelivered from the evils to come.\n\nI have too long digressed, and therefore shall return to my subject. I\nthink the advantages by the proposal which I have made are obvious and\nmany, as well as of the highest importance.\n\nFor first, as I have already observed, it would greatly lessen the\nnumber of Papists, with whom we are yearly over-run, being the principal\nbreeders of the nation, as well as our most dangerous enemies, and who\nstay at home on purpose with a design to deliver the kingdom to the\nPretender, hoping to take their advantage by the absence of so many good\nProtestants, who have chosen rather to leave their country, than stay at\nhome and pay tithes against their conscience to an episcopal curate.\n\nSecondly, The poorer tenants will have something valuable of their own,\nwhich by law may be made liable to a distress, and help to pay their\nlandlord's rent, their corn and cattle being already seized, and money a\nthing unknown.\n\nThirdly, Whereas the maintainance of an hundred thousand children,\nfrom two years old, and upwards, cannot be computed at less than\nten shillings a piece per annum, the nation's stock will be thereby\nencreased fifty thousand pounds per annum, besides the profit of a\nnew dish, introduced to the tables of all gentlemen of fortune in the\nkingdom, who have any refinement in taste. And the money will circulate\namong our selves, the goods being entirely of our own growth and\nmanufacture.\n\nFourthly, The constant breeders, besides the gain of eight shillings\nsterling per annum by the sale of their children, will be rid of the\ncharge of maintaining them after the first year.\n\nFifthly, This food would likewise bring great custom to taverns,\nwhere the vintners will certainly be so prudent as to procure the best\nreceipts for dressing it to perfection; and consequently have their\nhouses frequented by all the fine gentlemen, who justly value themselves\nupon their knowledge in good eating; and a skilful cook, who understands\nhow to oblige his guests, will contrive to make it as expensive as they\nplease.\n\nSixthly, This would be a great inducement to marriage, which all wise\nnations have either encouraged by rewards, or enforced by laws and\npenalties. It would encrease the care and tenderness of mothers towards\ntheir children, when they were sure of a settlement for life to the\npoor babes, provided in some sort by the publick, to their annual profit\ninstead of expence. We should soon see an honest emulation among the\nmarried women, which of them could bring the fattest child to the\nmarket. Men would become as fond of their wives, during the time of\ntheir pregnancy, as they are now of their mares in foal, their cows in\ncalf, or sow when they are ready to farrow; nor offer to beat or kick\nthem (as is too frequent a practice) for fear of a miscarriage.\n\nMany other advantages might be enumerated. For instance, the addition\nof some thousand carcasses in our exportation of barrel'd beef: the\npropagation of swine's flesh, and improvement in the art of making good\nbacon, so much wanted among us by the great destruction of pigs,\ntoo frequent at our tables; which are no way comparable in taste or\nmagnificence to a well grown, fat yearly child, which roasted whole will\nmake a considerable figure at a Lord Mayor's feast, or any other publick\nentertainment. But this, and many others, I omit, being studious of\nbrevity.\n\nSupposing that one thousand families in this city, would be constant\ncustomers for infants flesh, besides others who might have it at merry\nmeetings, particularly at weddings and christenings, I compute that\nDublin would take off annually about twenty thousand carcasses; and the\nrest of the kingdom (where probably they will be sold somewhat cheaper)\nthe remaining eighty thousand.\n\nI can think of no one objection, that will possibly be raised against\nthis proposal, unless it should be urged, that the number of people will\nbe thereby much lessened in the kingdom. This I freely own, and 'twas\nindeed one principal design in offering it to the world. I desire the\nreader will observe, that I calculate my remedy for this one individual\nKingdom of Ireland, and for no other that ever was, is, or, I think,\never can be upon Earth. Therefore let no man talk to me of other\nexpedients: Of taxing our absentees at five shillings a pound: Of using\nneither cloaths, nor houshold furniture, except what is of our\nown growth and manufacture: Of utterly rejecting the materials and\ninstruments that promote foreign luxury: Of curing the expensiveness of\npride, vanity, idleness, and gaming in our women: Of introducing a vein\nof parsimony, prudence and temperance: Of learning to love our\ncountry, wherein we differ even from Laplanders, and the inhabitants\nof Topinamboo: Of quitting our animosities and factions, nor acting any\nlonger like the Jews, who were murdering one another at the very moment\ntheir city was taken: Of being a little cautious not to sell our country\nand consciences for nothing: Of teaching landlords to have at least one\ndegree of mercy towards their tenants. Lastly, of putting a spirit of\nhonesty, industry, and skill into our shop-keepers, who, if a resolution\ncould now be taken to buy only our native goods, would immediately unite\nto cheat and exact upon us in the price, the measure, and the goodness,\nnor could ever yet be brought to make one fair proposal of just dealing,\nthough often and earnestly invited to it.\n\nTherefore I repeat, let no man talk to me of these and the like\nexpedients, 'till he hath at least some glympse of hope, that there will\never be some hearty and sincere attempt to put them into practice.\n\nBut, as to my self, having been wearied out for many years with offering\nvain, idle, visionary thoughts, and at length utterly despairing of\nsuccess, I fortunately fell upon this proposal, which, as it is wholly\nnew, so it hath something solid and real, of no expence and little\ntrouble, full in our own power, and whereby we can incur no danger\nin disobliging England. For this kind of commodity will not bear\nexportation, and flesh being of too tender a consistence, to admit a\nlong continuance in salt, although perhaps I could name a country, which\nwould be glad to eat up our whole nation without it.\n\nAfter all, I am not so violently bent upon my own opinion, as to reject\nany offer, proposed by wise men, which shall be found equally innocent,\ncheap, easy, and effectual. But before something of that kind shall be\nadvanced in contradiction to my scheme, and offering a better, I desire\nthe author or authors will be pleased maturely to consider two points.\nFirst, As things now stand, how they will be able to find food and\nraiment for a hundred thousand useless mouths and backs. And secondly,\nThere being a round million of creatures in humane figure throughout\nthis kingdom, whose whole subsistence put into a common stock, would\nleave them in debt two million of pounds sterling, adding those who are\nbeggars by profession, to the bulk of farmers, cottagers and labourers,\nwith their wives and children, who are beggars in effect; I desire\nthose politicians who dislike my overture, and may perhaps be so bold\nto attempt an answer, that they will first ask the parents of these\nmortals, whether they would not at this day think it a great happiness\nto have been sold for food at a year old, in the manner I prescribe, and\nthereby have avoided such a perpetual scene of misfortunes, as they have\nsince gone through, by the oppression of landlords, the impossibility of\npaying rent without money or trade, the want of common sustenance, with\nneither house nor cloaths to cover them from the inclemencies of the\nweather, and the most inevitable prospect of intailing the like, or\ngreater miseries, upon their breed for ever.\n\nI profess, in the sincerity of my heart, that I have not the least\npersonal interest in endeavouring to promote this necessary work, having\nno other motive than the publick good of my country, by advancing\nour trade, providing for infants, relieving the poor, and giving some\npleasure to the rich. I have no children, by which I can propose to\nget a single penny; the youngest being nine years old, and my wife past\nchild-bearing.";

		FileOutputStream fos;
		try {
			fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
			fos.write(string.getBytes());
			fos.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		try {
			InputStream in = openFileInput("inception.inception");
			if (in!=null) {
				BufferedReader bro = new BufferedReader(new InputStreamReader(in));
				String line;
				LinearLayout scrollLinear = ((LinearLayout) findViewById(R.id.linearLayout1));
				while ((line=bro.readLine())!=null) {
					//Toast.makeText(this, line, Toast.LENGTH_SHORT).show();
					deliciousbabies+=line+" ";
					if (line.equals("")) {
						deliciousbabies+="\n\n";
					}
					
					
				}
				TextView tv = new TextView(cxt);
				tv.setText(deliciousbabies);
				scrollLinear.addView(tv);
			}
		} catch (FileNotFoundException fnfe) {
			Toast.makeText(this, "File not found!", Toast.LENGTH_SHORT).show();
			fnfe.printStackTrace();
		} catch (IOException ioe) {
			Toast.makeText(this, "File read error!", Toast.LENGTH_SHORT).show();
			ioe.printStackTrace();
		}
		
		/*AlertDialog.Builder adb = new AlertDialog.Builder(this);
		adb.setTitle("errorz!");
		adb.setMessage("Do you know the muffin man?");
		adb.setPositiveButton("Yes", (android.content.DialogInterface.OnClickListener) this);
		adb.setNeutralButton("Meh", (android.content.DialogInterface.OnClickListener) this);
		adb.setNegativeButton("No", (android.content.DialogInterface.OnClickListener) this);
		adb.show();*/
	}

	public void onClick(DialogInterface di, int btnid) {
		if (btnid==DialogInterface.BUTTON_POSITIVE) {
			Toast.makeText(this, "yay!", Toast.LENGTH_SHORT).show();
		} else if (btnid==DialogInterface.BUTTON_NEUTRAL) {
			Toast.makeText(this, "well okay then", Toast.LENGTH_SHORT).show();
		} else if (btnid==DialogInterface.BUTTON_NEGATIVE) {
			Toast.makeText(this, "aww", Toast.LENGTH_SHORT).show();
			System.exit(0);
		}
	}
}